/**
 * Created with IntelliJ IDEA.
 * User: wenxiwen
 * Date: 2022/4/7
 * Time: 20:19
 * Description: No Description
 */
class A {

    public void eat() {
        System.out.println("打印图形");
    }
}

class B extends A{

    @Override
    public void eat() {
        System.out.println("△");
    }
}

class C extends A {
    @Override
    public void eat() {
        System.out.println("○");
    }
}

class D extends A {
    @Override
    public void eat() {
        System.out.println("□");
    }
}

public class Test {
    public static void pos(A init ) {
        init.eat();
    }
    public static void main(String[] args) {
        pos(new A());
        pos(new B());
        pos(new C());
        pos(new D());
    }
}